<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <title>浙江数字人社工作台</title>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />


    <link rel="SHORTCUT ICON" href="/sso/images/favicon.ico" type="image/x-icon" />
<script src="../js/tz_cfg.js?version=2.0.6" type="text/javascript"></script>
<script type="text/javascript">tz.cfg.base="/sso"</script>

<script src="../js/scripts/boot.js"type="text/javascript"></script>

<!-- 引入MiniUI的样式 -->
<!-- <link href="../plugin/miniui/default/miniui.css" rel="stylesheet" type="text/css" /> -->
<link href="../plugin/miniui/default/medium-mode.css" rel="stylesheet" type="text/css" />

<link href="../js/scripts/miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />
<link href="../css/common_ext.css" rel="stylesheet" type="text/css" />
<link href="../css/common.css" rel="stylesheet" type="text/css" />

<link href="../css/mgr/baseStyle.css" rel="stylesheet" type="text/css" />
<link href="../css/color.css" rel="stylesheet" type="text/css" />
<link href="../css/skin.css" rel="stylesheet" type="text/css" />
<link href="../css/tz-skin.css" rel="stylesheet" type="text/css" />

</head>

<body>
    <link rel="stylesheet" href="../css/mgr/baseStyle.css?v=2.0.0">
    <!-- 使用 mini表格 需要加上 mini-layout类-->
    <div class="mini-layout mainCon">
        <div region="center" width="auto" style="border:0px">
            <div class="mini-toolbar" borderStyle="border:0" style=" padding-top:11px;">
                <table id="searchUserForm" style="width:100%;">
                    <tr style="width: 100%">
                        <td style="white-space:nowrap;" class="mini-col-4">
                            <input class="mini-textbox" labelField="true" label="姓名" labelStyle="width:80px"
                                id="searchNameKey" name="searchNameKey" width="95%" maxLength="50"
                                onenter="searchNameKey()" emptyText="" />
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-textbox" labelField="true" label="身份证号码" labelStyle="width:80px"
                                id="searchUserID" name="searchUserID" width="95%" maxLength="50"
                                onenter="searchUserID()" emptyText="" />
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-textbox" labelField="true" label="机构" labelStyle="width:80px"
                                id="searchJg" name="searchJg" width="95%" maxLength="50"
                                onenter="searchJg()" emptyText="" />
                        </td>

                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="userType" name="isPr" labelStyle="width:80px"
                                labelField="true" label="是否聘任" width="95%" showNullItem="true" allowInput="false"
                                textField="text" valueField="id"
                                data='[{"id":"0","text":"全部"},{"id":"1","text":"是"},{"id":"2","text":"否"}]' />
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="PrType" name="diquType" labelStyle="width:80px"
                                labelField="true" label="聘任类型" width="95%" textField="text" valueField="id"
                                data='[{"id":"0","text":"全部"},{"id":"1","text":"专职"},{"id":"2","text":"兼职"},{"id":"3","text":"空"}]'
                                showNullItem="true" allowInput="false" />
                        </td>
                        <td class="mini-col-4">
                            <div class="mini-toolbar" borderStyle="border:0">
                                <div class="btnCon">
                                    <a class="mini-button blueBtn mini-button-text" onclick="searchOrgByKey()"
                                        tooltip="查询">查询</a>
                                    <a class="mini-button reload blueBtn" onclick="resetSearchOrgByKey()"
                                        tooltip="重置">重置</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a class="mini-button reload icon" iconCls="fa fa-plus" onclick="onAdd()"
                                tooltip="新增...">新增</a>
                                <a class="mini-button reload icon" iconCls="fa fa-plus" onclick="onDaoChu()"
                                tooltip="导出...">导出</a>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="mini-fit" borderStyle="border:0">
                <div id="grid" borderStyle="border:0" showHGridLines="false" showVGridLines="false"
                    class="mini-datagrid" width="100%" height="100%" url="../json/ry.json" pageSize="15"
                    autoLoad="true" onpreload="preLoadGrid">
                    <div property="columns">
                        <div type="indexcolumn" width="40" headeralign="center" align="center">序号</div>
                        <div field="userName" headeralign="center" width="60" align="center">姓名</div>
                        <div field="userID" headeralign="center" width="80" align="center">身份证号码</div>
                        <div field="jg" headeralign="center" width="60" align="center">机构</div>
                        <div field="isPr" headeralign="center" width="140" align="center">是否聘任</div>
                        <div field="PrType" headeralign="center" width="140" align="center">聘任类型</div>
                        <div field="StartTime" headeralign="center" width="140" align="center">聘任开始时间</div>
                        <div field="EndTime" headeralign="center" width="140" align="center">聘任结束时间</div>
                        <div field="#" headeralign="center" width="240" align="center" renderer="onRenderer"
                            align="center">
                            操作
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>


<script type="text/javascript">
    mini.parse();
    var grid = tz.get('grid');
    var tree = tz.get("tree");
    // 整个培训表单
    var searchPeixunForm = tz.form("#searchUserForm");

    //重置按钮
    function resetSearchOrgByKey(e) {
        tz.get("searchClassKey").setValue("");
        tz.get("searchClassName").setValue("");
    }
    // 渲染 编辑页面
      // 渲染 编辑页面
      function onRenderer(e) {
        var htmlStr;
        var record = e.record;
        if (record.userName != '') {
            htmlStr = '<a class="gridBtn" onclick="onUpdata()">修改人员</a><a class="gridBtn" onclick="onSearch()">删除</a>';
            htmlStr += '<a class="gridBtn" onclick="onZhuxiao()">查看</a>';
            htmlStr += '<a class="gridBtn" onclick="onShouquan()">解聘</a>';
            htmlStr += '<a class="gridBtn" onclick="onShouquan()">续聘</a>';
        } else {
            htmlStr =
                '<a class="gridBtn" onclick="onEdit()">编辑</a><a class="gridBtn" onclick="onResetPassword()">重置密码</a>';
            if (record.locked == '0') {
                htmlStr += '<a class="gridBtn" onclick="unlocked()">解锁</a>';
            } else {
                htmlStr += '<a class="gridBtn" onclick="locked()">锁定</a>';
            }
            htmlStr += '<a class="gridBtn" onclick="onCancel()">注销</a>';
        }
        return htmlStr;
    }

    //按照搜索条件 搜索班级
    function searchOrgByKey() {
        var searchClassKey = tz.get("searchClassKey").getValue();
        var searchClassName = tz.get("searchClassName").getValue();

        if (searchOrgKey) {
            tree.load(tz.url("/sys/org/queryManagerTreeByName", {
                searchOrgKey: searchOrgKey
            }));
        } else {
            tree.load(tz.url("/sys/org/queryManagerLazyTree"));
        }
    }

    function preLoadGrid(e) {
        // console.log(e,'preLoadGrid')
            var data = e.data;
            for (var i = 0; i < data.length; i++) {
                var item = data[i];
                console.log(item.aaa020,222);
                if (item.aaa020) {
                    item.aab300 = (item.aab300 + "(" + item.aaa020 + ")");
                }
            }
        }



</script>

</html>